home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6218 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: solon.com!not-for-mail
  2. From: seebs@solutions.solon.com (Peter Seebach)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: What to do when feof() is NOT feof()
  5. Date: 22 Feb 1996 19:47:28 -0600
  6. Organization: Usenet Fact Police (Undercover)
  7. Message-ID: <4gj6bg$mrv@solutions.solon.com>
  8. References: <4g7rsj$fnf@spectator.cris.com> <1996Feb19.063026.29889@zcon.com> <4gb7r3$p4k@sun001.spd.dsccc.com>
  9. NNTP-Posting-Host: solutions.solon.com
  10.  
  11. In article <4gb7r3$p4k@sun001.spd.dsccc.com>,
  12. Mike McCarty <jmccarty@spd.dsccc.com> wrote:
  13. >)Note that even the EOF result returned (look in stdio.h) has nothing to
  14. >)do with the actual byte at the end of the file.
  15.  
  16. >Yes, it does, on some systems. This is a very strong statement for you
  17. >to make, especially in light of the next statement.
  18.  
  19. No, it doesn't.  Not on *any* system.  Why?  Because EOF is a negative
  20. integer constant, and getchar/getc/fgetc all return the next available
  21. character *as an unsigned char* or EOF.  EOF can *NEVER* be the same
  22. as *ANY* character in the file, nor can it be the byte at the end of
  23. a file.  (Unless your implementation has int and char be the same size, and
  24. all possible values of int are legal char values as well, but this may
  25. not be allowed by the standard, and is certainly not going to be seen
  26. as a quality implementation.)
  27.  
  28. So no, EOF does *not* have anything to do with the byte at the end of the
  29. file.  :)
  30.  
  31. >It would be a lot calmer and more fun to read this group if people could
  32. >treat each other with a normal dose of courtesy.
  33.  
  34. Yup.  The question is, when someone rudely barges into a C user's group
  35. meeting and starts discussing stuff specific to something other than C,
  36. does this violation of courtesy entitle us to be rude to them?  I think
  37. so, although I prefer not to be rude anyway.
  38.  
  39. -- 
  40. Peter Seebach - seebs@solon.com - Copyright 1995 Peter Seebach.
  41. C/Unix wizard -- C/Unix questions? Send mail for help.  No, really!
  42. FUCK the communications decency act.  Goddamned government.  [literally.]
  43. The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.txt
  44.